<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<style type="text/css">
.dateWidth1{
   width:195px;
}
.selectWidth2{
   width:205px;
}
</style>
<x:parse xml="${param.xmlstr}" var="xmlData" />
<div class="t_bar">基本信息</div>
<table class="t_css" width="100%" border="0" cellpadding="0" id="basicInfoyq" width="100%" 
	cellspacing="1">
	<tr>
		<td  align="right"><span class="color_red">*</span>园区名称：</td>
		<td  colspan="5">
			<input name="proposal/yq_name" label="园区名称" type="text" required class="input_css required "  style="width: 680px;" maxlength="60" value="<x:out select="$xmlData/data/proposal/yq_name" />"/> 
		</td>
	</tr>
	<tr>
		<td  align="right"><span class="color_red">*</span>园区地址：</td>
		<td  colspan="5">
			<input name="proposal/yq_address" label="园区地址" type="text" required class="input_css required "  style="width: 680px;" maxlength="60" value="<x:out select="$xmlData/data/proposal/yq_address" />"/> 
		</td>
	</tr>
	<tr>
	<td  align="right"><span class="color_red">*</span>评定称号：</td>
	<td nowrap colspan="5">
			<c:set var="designation"><x:out select="$xmlData/data/proposal/designation_value" /></c:set>
			<cpt:select id="designation"  key="designation"  className="select_width" value="${designation}"  onChange=""></cpt:select>
			<input type="hidden" id="designation_value" name="proposal/designation_value" class="required" value="${designation}" label="评定称号">
			<input type="hidden" name="proposal/designation_name" value="<x:out select="$xmlData/data/proposal/designation_name" />">
	</td>
	</tr>
	<tr>
	<td  align="right"><span class="color_red">*</span>园区面积(㎡)：</td>
	<td  colspan="2">
			<input name="proposal/yq_area" id="yq_area" label="园区面积" type="text" required class="input_css required valueCompare:yqwh_area:yq_area" style="text-align: right" onfocus="InitInput.setNumber(this,7,4,2)"	 value="<x:out select="$xmlData/data/proposal/yq_area" />"/>
	</td>
	<td  align="right"><span class="color_red">*</span>其中文化类面积(㎡)：</td>
	<td  colspan="2">
			<input name="proposal/yqwh_area" id="yqwh_area" label="其中文化类面积" type="text" required class="input_css required " style="text-align: right" onfocus="InitInput.setNumber(this,7,4,2)"	 value="<x:out select="$xmlData/data/proposal/yqwh_area" />"/>
	</td>
	</tr>
	<tr>
	<td rowspan="4" align="right" width="16%"><span class="color_red">*</span>园区入驻企业数：</td>
	<td rowspan="4" width="16%"><input name="proposal/yq_total" id="yq_total" onchange="percentage('yq_total','yq_whqy','yq_whqybl');percentage('yq_total','yq_low','yq_lowbl');percentage('yq_total','yq_middle','yq_middlebl');percentage('yq_total','yq_hight','yq_hightbl');" label="园区入驻企业数" type="text" required class="input_css required " style="text-align: right" onfocus="InitInput.setNumber(this,7,0,0)"	 value="<x:out select="$xmlData/data/proposal/yq_total" />"/></td>
	<td align="right" width="16%"><span class="color_red">*</span>其中文化企业数：</td>
	<td width="16%"><input name="proposal/yq_whqy" id="yq_whqy" onchange="percentage('yq_total','yq_whqy','yq_whqybl');" label="其中文化企业数" type="text" required class="input_css required  valueGreatEqual:yq_total:yq_whqy" style="text-align: right" onfocus="InitInput.setNumber(this,7,0,0)"	 value="<x:out select="$xmlData/data/proposal/yq_whqy" />"/></td>
	<td align="right" width="16%">占比：</td>
	<td width="16%"><span name="proposal/yq_whqybl" id="yq_whqybl"><x:out select="$xmlData/data/proposal/yq_whqybl" /></span></td>
	</tr>
	<tr>
	<td align="right" nowrap><span class="color_red">*</span>其中超千万元企业数：</td>
	<td><input name="proposal/yq_low" id="yq_low" onchange="percentage('yq_total','yq_low','yq_lowbl');" label="其中超千万元企业数" type="text" required class="input_css required valueGreatEqual:yq_total:yq_low" style="text-align: right" onfocus="InitInput.setNumber(this,7,0,0)"	 value="<x:out select="$xmlData/data/proposal/yq_low" />"/></td>
	<td align="right">占比：</td>
	<td><span name="proposal/yq_lowbl" id="yq_lowbl" ><x:out select="$xmlData/data/proposal/yq_lowbl" /></span></td>
	</tr>
	<tr>
	<td align="right" nowrap><span class="color_red">*</span>其中超五千万元企业数：</td>
	<td><input name="proposal/yq_middle" id="yq_middle" onchange="percentage('yq_total','yq_middle','yq_middlebl');" label="其中超五千万元企业数" type="text" required class="input_css required valueGreatEqual:yq_total:yq_middle" style="text-align: right" onfocus="InitInput.setNumber(this,7,0,0)"	 value="<x:out select="$xmlData/data/proposal/yq_middle" />"/></td>
	<td align="right">占比：</td>
	<td><span name="proposal/yq_middlebl" id="yq_middlebl"><x:out select="$xmlData/data/proposal/yq_middlebl" /></span></td>
	</tr>
	<tr>
	<td align="right" nowrap><span class="color_red">*</span>其中超亿元企业数：</td>
	<td ><input name="proposal/yq_hight" id="yq_hight" onchange="percentage('yq_total','yq_hight','yq_hightbl');" label="其中超亿元企业数" type="text" required class="input_css required valueGreatEqual:yq_total:yq_hight" style="text-align: right" onfocus="InitInput.setNumber(this,7,0,0)"	 value="<x:out select="$xmlData/data/proposal/yq_hight" />"/></td>
	<td align="right">占比：</td>
	<td><span name="proposal/yq_hightbl" id="yq_hightbl"><x:out select="$xmlData/data/proposal/yq_hightbl" /></span></td>
	</tr>
</table>

<div class="t_bar">园区企业上年度经济效益（万元）</div>
<table class="table01 t_css" width="100%" border="0" cellpadding="0" id="basicInfoyq"
	cellspacing="1">
	<tr>
	<td align="right" width="16%"><span class="color_red">*</span>销售总额：</td>
	<td width="16%"><input name="proposal/sell_total" label="销售总额" type="text" id="sell_total"  class="input_css required valueCompare:wh_sell:sell_total" style="text-align: right" onfocus="InitInput.setNumber(this,7,4,2)"	 value="<x:out select="$xmlData/data/proposal/sell_total" />"/></td>
	<td align="right" width="16%"><span class="color_red">*</span>文化企业销售：</td>
	<td width="16%"><input name="proposal/wh_sell" label="文化企业销售" type="text" id="wh_sell"  class="input_css required " style="text-align: right" onfocus="InitInput.setNumber(this,7,4,2)"	 value="<x:out select="$xmlData/data/proposal/wh_sell" />"/></td>
	<td align="right" width="16%"><span class="color_red">*</span>同比增幅（%）：</td>
	<td width="16%"><input name="proposal/increate_sell" label="销售同比增幅" type="text"  class="input_css required " style="text-align: right" onfocus="InitInput.setNumber(this,9,2,2,null,true)"	 value="<x:out select="$xmlData/data/proposal/increate_sell" />"/></td>
	</tr>
	<tr>
	<td align="right"><span class="color_red">*</span>利润总额：</td>
	<td ><input name="proposal/profit_total" label="利润总额" type="text" id="profit_total" class="input_css required valueCompare:wh_profit:profit_total" style="text-align: right" onfocus="InitInput.setNumber(this,7,4,2)"	 value="<x:out select="$xmlData/data/proposal/profit_total" />"/></td>
	<td align="right"><span class="color_red">*</span>文化企业利润：</td>
	<td><input name="proposal/wh_profit" label="文化企业利润" type="text" id="wh_profit" class="input_css required " style="text-align: right" onfocus="InitInput.setNumber(this,7,4,2)"	 value="<x:out select="$xmlData/data/proposal/wh_profit" />"/></td>
	<td align="right"><span class="color_red">*</span>同比增幅（%）：</td>
	<td><input name="proposal/increate_profit" label="利润同比增幅" type="text"  class="input_css required " style="text-align: right" onfocus="InitInput.setNumber(this,9,2,2,null,true)"	 value="<x:out select="$xmlData/data/proposal/increate_profit" />"/></td>
	</tr>
	<tr>
	<td align="right"><span class="color_red">*</span>税收总额：</td>
	<td ><input name="proposal/tax_total" label="税收总额" type="text" id="tax_total" class="input_css required valueCompare:wh_tax:tax_total" style="text-align: right" onfocus="InitInput.setNumber(this,7,4,2)"	 value="<x:out select="$xmlData/data/proposal/tax_total" />"/></td>
	<td align="right"><span class="color_red">*</span>文化企业税收：</td>
	<td><input name="proposal/wh_tax" label="文化企业税收" type="text" id="wh_tax" class="input_css required " style="text-align: right" onfocus="InitInput.setNumber(this,7,4,2)"	 value="<x:out select="$xmlData/data/proposal/wh_tax" />"/></td>
	<td align="right"><span class="color_red">*</span>同比增幅（%）：</td>
	<td><input name="proposal/increate_tax" label="税收同比增幅" type="text"  class="input_css required " style="text-align: right" onfocus="InitInput.setNumber(this,9,2,2,null,true)"	 value="<x:out select="$xmlData/data/proposal/increate_tax" />"/></td>
	</tr>
</table>

<script type="text/javascript">
	$(function() {
		$("#basicInfoyq tr:even").addClass("li_1");
		$("#basicInfoyq tr:odd").addClass("li_2");
	});
	
	function addNewRowDeal(table)
	{
		var maxLinNum=table.find("tr").length-3;;//获得行数，减去表头和隐藏行
		var lineNum=""+(maxLinNum+1);
		
		var addHtml=table.find("tr")[2].innerHTML;//获得隐藏行的html,查找第二行
		addHtml=addHtml.replace(/\[index\]/g,lineNum);
		lineNum = (parseInt(lineNum, 10)-1).toString();//2011.12.13 行下标比行号小1(隐藏行下标[0]，第一行下标[00])
		if (lineNum.length==1)//如果是个位数，前面补0
			lineNum="0"+lineNum;
		addHtml=addHtml.replace(/\[0\]/g,"["+lineNum+"]");//替换html中行号
		addHtml=addHtml.replace(/\|/g,"/");//替换html中节点/的代替符"|"
		table.append("<tr>"+addHtml+"</tr>");//将html增加到最后
	
	}
	/**
	 * 获取焦点去掉千分位
	 * @param obj 焦点对象
	 */
	function financeFocus(obj) {
		var value = $(obj).val();
		value = value.replace(new RegExp("\,","g"), "");
		$(obj).val(value).select();
	}
	/**
	 * 失去焦点设置千分位
	 * @param obj 焦点对象Id
	 */
	function financeBlur(objId) {
		var obj = $("#"+objId);
		var value = obj.val();
		if (value == null || value == undefined || value == "") {
			return false;
		}
		obj.val(thousandsNumber(obj.val()));
	}
	/**
	 * 将值以千分位显示
	 * @param value 数值
	 */
	function thousandsNumber(value) {
		if (value == null || value == undefined || value == "") {
			return "";
		}
		var negative = '';
		var intVal = value.split(".")[0];
		var j = intVal.length;
		if(intVal.charAt(0) == '-'){
			negative = '-';
			intVal = intVal.substr(1, j);
		}
		j = intVal.length;
		for(var i=j-3; i>0; i=i-3){
			intVal = intVal.substr(0, i) + "," + intVal.substr(i, j);
		}
		if(value.split(".")[1] != null){
			return (negative + intVal + '.' + value.split(".")[1]);
		} else{
			return (negative + intVal);
		}
	}
	
	/**
	 * 设置小数位数
	 * @param num 数字
	 * @param isInt 是否是整数，是则不设置小数
	 */
	function setDecimalLen(num, isInt) {
		if (isInt == null) {
			isInt = false;
		}
		if (!isInt) {
			if ((num+"").indexOf(".") >= 0) {
				num=  new Number(num);
				var decimalLen = (num+"").length-((num+"").indexOf(".")+1);
				if (decimalLen <= 2)
					num = num.toFixed(2);
				else if (decimalLen >= 3)
					num = num.toFixed(4);
			} else {
				num=  new Number(num);
				num = num.toFixed(2);
			}
		}
		return num;
	}
	
	/** 
	 *(重写)
	 * 经费计算（保留两位小数点的情况）
	 * 两位小数相加，结果返回两位小数据
	 */
	function countFund2(idStart, countStr, totalStr) {
		var indexs = countStr.split(",");
		var count = 0;
		for ( var i = 0; i < indexs.length; i++) {
			var fund = $("#" + idStart + indexs[i]).val();
			fund = fund.replace(/,/g,'');//重写添加
			if (!$.isNumeric(fund))
				fund = "0";
			count = ((parseFloat(count)*10000 + parseFloat(fund)*10000)/10000).toFixed(2);
		}
		count = formatNumber(count.toString(), 7, 4, 2);// 格式化金额
		$("#" + idStart + totalStr).val(thousandsNumber(count));	
	}
	
	function percentage(id1,id2,id3){
		var val1 = $("#"+id1).val();
		var val2 = $("#"+id2).val();
		if(val1=='' || val1 == 0){
			$("#"+id3).text("");
		    return;
		}else{
			$("#"+id3).text((((val2/val1)*1000000)/10000).toFixed(2)+"%");
		}
	}

 </script>
	

